<div class="Huialert Huialert-success"><i class="icon-remove"></i>鼠标移开，自动保存更改</div>
<article class="page-container">
<style>
.layui-form-label{width:300px;}
.layui-input-block{margin-left: 330px;}
</style>
	<form action="">
	<{volist name='list' id='v'}>
	  <div class="layui-form-item">
	    <label class="layui-form-label">[<{$v['k']}>]&nbsp;&nbsp;<{$v['d']}></label>
	    <div class="layui-input-block">
	    	<{switch name="v.type"}>
	    		<{case value="input"}><input type="text" class="layui-input" _url='<{:url('c/edit')}>' _t='sys' _id='<{$v['id']}>' _f='v' onchange="c_change(this)" value="<{$v['v']}>" ><{/case}>
	    		<{case value="file"}>
					<input type="file" name="file" lay-type="file" _url="<{:url('sys/upfile','id='.$v['id'])}>" onclick="c_up(this,'add')">
					<span _span="<{$v['id']}>">
					<{if $v['v']}>
						<img src="\<{$v['v']}>" height=50 />
						<span class="ckbox ckbox-primary">
							<input type="checkbox" name="delete_pic" value="yes"  _t='sys' _id='<{$v['id']}>' _f='v' _url="<{:url('sys/del')}>" msg="你确定要删除图片吗？" onclick="p_del(this)" id="delete_pic_<{$v.id}>">
							<label for="delete_pic_<{$v.id}>">&nbsp;删除图片</label>
						</span>
					<{/if}>
					</span>
				<{/case}>
	    		<{case value="textarea"}>
	    			<textarea  _url='<{:url('c/edit')}>' _t='sys' _id='<{$v['id']}>' _f='v' onchange="c_change(this)" placeholder="请输入内容" class="layui-textarea"><{$v['v']}></textarea>
				<{/case}>
	    	<{/switch}>
	    </div>
	  </div>
	<{/volist}>	  
	</form>
</article>
<script type="text/javascript">
function p_del(e){
	var checked = $(e).prop("checked");
	if( checked ){
		var msg  = $(e).attr('msg');
		var url = $(e).attr('_url');
		
		var post    = {};
		post['t']  = $(e).attr('_t');
		post['id'] = $(e).attr('_id');
		post[$(e).attr('_f')] = '';
		
		layer.confirm(msg, {icon: 3}, function(index){
			_ajax(url, post);
		});
		return false;
	}
}
</script>